package com.nsgf.library.data.bean;

import com.nsgf.library.data.api.APIs;
import com.nsgf.library.widget.prckerview.model.IPickerViewData;

import java.util.List;

public class ConfirmOrderBean {
    private double type;
    private PriceBean price;
    private Object address;
    private double usePoint;
    private double totalPoint;
    private String tenantName;
    private double consumptionPoints;
    private double welfarePoints;
    private double zhhtCoin;
    private double contributionValue;
    private double loveFund;
    private List<ItemsBean> items;

    private List<DeliveryTypeListBean> deliveryTypeList;
    private List<CouponsDTO> coupons;
    private List<PromotionsDTO> promotions;


    public double getType() {
        return type;
    }

    public void setType(double type) {
        this.type = type;
    }

    public PriceBean getPrice() {
        return price;
    }

    public void setPrice(PriceBean price) {
        this.price = price;
    }

    public Object getAddress() {
        return address;
    }

    public void setAddress(Object address) {
        this.address = address;
    }

    public double getUsePoint() {
        return usePoint;
    }

    public void setUsePoint(double usePoint) {
        this.usePoint = usePoint;
    }

    public double getTotalPoint() {
        return totalPoint;
    }

    public String getTotalPointSrc() {
        return APIs.df.format(totalPoint / 100);
    }

    public void setTotalPoint(double totalPoint) {
        this.totalPoint = totalPoint;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public double getConsumptionPoints() {
        return consumptionPoints;
    }

    public void setConsumptionPoints(double consumptionPoints) {
        this.consumptionPoints = consumptionPoints;
    }

    public double getWelfarePoints() {
        return welfarePoints;
    }

    public String getWelfarePointsSrc() {
        return APIs.df.format(welfarePoints / 100);
    }

    public void setWelfarePoints(double welfarePoints) {
        this.welfarePoints = welfarePoints;
    }

    public double getZhhtCoin() {
        return zhhtCoin;
    }

    public String getZhhtCoinSrc() {
        return APIs.df.format(zhhtCoin / 100);
    }

    public void setZhhtCoin(double zhhtCoin) {
        this.zhhtCoin = zhhtCoin;
    }

    public double getContributionValue() {
        return contributionValue;
    }

    public String getContributionValueSrc() {
        return APIs.df.format(contributionValue / 100);
    }

    public void setContributionValue(double contributionValue) {
        this.contributionValue = contributionValue;
    }

    public double getLoveFund() {
        return loveFund;
    }

    public String getLoveFundSrc() {
        return APIs.df.format(loveFund / 100);
    }

    public void setLoveFund(double loveFund) {
        this.loveFund = loveFund;
    }

    public List<ItemsBean> getItems() {
        return items;
    }

    public void setItems(List<ItemsBean> items) {
        this.items = items;
    }

    public List<DeliveryTypeListBean> getDeliveryTypeList() {
        return deliveryTypeList;
    }

    public void setDeliveryTypeList(List<DeliveryTypeListBean> deliveryTypeList) {
        this.deliveryTypeList = deliveryTypeList;
    }

    public List<CouponsDTO> getCoupons() {
        return coupons;
    }

    public void setCoupons(List<CouponsDTO> coupons) {
        this.coupons = coupons;
    }

    public List<PromotionsDTO> getPromotions() {
        return promotions;
    }

    public void setPromotions(List<PromotionsDTO> promotions) {
        this.promotions = promotions;
    }

    public static class PriceBean {

        private double totalPrice;
        private double discountPrice;
        private double deliveryPrice;
        private double couponPrice;
        private double pointPrice;
        private double vipPrice;
        private double payPrice;

        public double getTotalPrice() {
            return totalPrice;
        }

        public String getTotalPriceSrc() {
            return APIs.df.format(totalPrice / 100);
        }

        public void setTotalPrice(double totalPrice) {
            this.totalPrice = totalPrice;
        }

        public double getDiscountPrice() {
            return discountPrice;
        }

        public String getDiscountPriceSrc() {
            return APIs.df.format(discountPrice / 100);
        }

        public void setDiscountPrice(double discountPrice) {
            this.discountPrice = discountPrice;
        }

        public double getDeliveryPrice() {
            return deliveryPrice;
        }

        public String getDeliveryPriceSrc() {
            if (getDeliveryPrice() == 0)
                return "免运费";
            return APIs.df.format(deliveryPrice / 100);
        }

        public void setDeliveryPrice(double deliveryPrice) {
            this.deliveryPrice = deliveryPrice;
        }

        public double getCouponPrice() {
            return couponPrice;
        }

        public String getCouponPriceSrc() {
            return APIs.df.format(couponPrice / 100);
        }

        public void setCouponPrice(double couponPrice) {
            this.couponPrice = couponPrice;
        }

        public double getPointPrice() {
            return pointPrice;
        }

        public String getPointPriceSrc() {
            return APIs.df.format(pointPrice / 100);
        }

        public void setPointPrice(double pointPrice) {
            this.pointPrice = pointPrice;
        }

        public double getVipPrice() {
            return vipPrice;
        }

        public String getVipPriceSrc() {
            return APIs.df.format(vipPrice / 100);
        }

        public void setVipPrice(double vipPrice) {
            this.vipPrice = vipPrice;
        }

        public double getPayPrice() {
            return payPrice;
        }

        public String getPayPriceSrc() {
            return APIs.df.format(payPrice / 100);
        }

        public void setPayPrice(double payPrice) {
            this.payPrice = payPrice;
        }
    }

    public static class ItemsBean {
        /**
         * categoryId : 19
         * spuId : 779
         * spuName : 定制POLO衫
         * skuId : 202
         * price : 6800
         * picUrl : https://zhonghehuitong.com.cn/zhht/acb43d85e118eea123d8e54cd603a8eef129fdeff6a3d8cb86a8ee8c93a42f80.png
         * properties : [{"propertyId":1,"propertyName":"颜色","valueId":41,"valueName":"橙色"},{"propertyId":2,"propertyName":"尺寸","valueId":42,"valueName":"L"}]
         * cartId : 256
         * count : 2
         */

        private int categoryId;
        private double spuId;
        private String spuName;
        private double skuId;
        private double price;
        private String picUrl;
        private String cartId;
        private double count;
        private List<PropertiesBean> properties;

        public int getCategoryId() {
            return categoryId;
        }

        public void setCategoryId(int categoryId) {
            this.categoryId = categoryId;
        }

        public double getSpuId() {
            return spuId;
        }

        public void setSpuId(double spuId) {
            this.spuId = spuId;
        }

        public String getSpuName() {
            return spuName;
        }

        public void setSpuName(String spuName) {
            this.spuName = spuName;
        }

        public double getSkuId() {
            return skuId;
        }

        public void setSkuId(double skuId) {
            this.skuId = skuId;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public String getCartId() {
            return cartId;
        }

        public void setCartId(String cartId) {
            this.cartId = cartId;
        }

        public double getCount() {
            return count;
        }

        public void setCount(double count) {
            this.count = count;
        }

        public List<PropertiesBean> getProperties() {
            return properties;
        }

        public void setProperties(List<PropertiesBean> properties) {
            this.properties = properties;
        }

        public static class PropertiesBean {
            /**
             * propertyId : 1
             * propertyName : 颜色
             * valueId : 41
             * valueName : 橙色
             */

            private double propertyId;
            private String propertyName;
            private double valueId;
            private String valueName;

            public double getPropertyId() {
                return propertyId;
            }

            public void setPropertyId(double propertyId) {
                this.propertyId = propertyId;
            }

            public String getPropertyName() {
                return propertyName;
            }

            public void setPropertyName(String propertyName) {
                this.propertyName = propertyName;
            }

            public double getValueId() {
                return valueId;
            }

            public void setValueId(double valueId) {
                this.valueId = valueId;
            }

            public String getValueName() {
                return valueName;
            }

            public void setValueName(String valueName) {
                this.valueName = valueName;
            }
        }
    }

    public static class DeliveryTypeListBean implements IPickerViewData {
        /**
         * code : 2
         * name : 用户自提
         */

        private int code;
        private String name;

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public String getPickerViewText() {
            return getName();
        }
    }

    public static class CouponsDTO {
        private int id;
        private String name;
        private Integer usePrice;
        private Long validStartTime;
        private Long validEndTime;
        private Integer discountType;
        private Integer discountPercent;
        private Integer discountPrice;
        private Integer discountLimitPrice;
        private Boolean match;
        private Object mismatchReason;
        private int status;
        private String templateId;
        private String takeType;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public String getNameSrc() {
            return "获得" + name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getUsePrice() {
            return usePrice;
        }

        public void setUsePrice(Integer usePrice) {
            this.usePrice = usePrice;
        }

        public Long getValidStartTime() {
            return validStartTime;
        }

        public void setValidStartTime(Long validStartTime) {
            this.validStartTime = validStartTime;
        }

        public Long getValidEndTime() {
            return validEndTime;
        }

        public void setValidEndTime(Long validEndTime) {
            this.validEndTime = validEndTime;
        }

        public Integer getDiscountType() {
            return discountType;
        }

        public void setDiscountType(Integer discountType) {
            this.discountType = discountType;
        }

        public Integer getDiscountPercent() {
            return discountPercent;
        }

        public void setDiscountPercent(Integer discountPercent) {
            this.discountPercent = discountPercent;
        }

        public Integer getDiscountPrice() {
            return discountPrice;
        }

        public void setDiscountPrice(Integer discountPrice) {
            this.discountPrice = discountPrice;
        }

        public Integer getDiscountLimitPrice() {
            return discountLimitPrice;
        }

        public void setDiscountLimitPrice(Integer discountLimitPrice) {
            this.discountLimitPrice = discountLimitPrice;
        }

        public Boolean isMatch() {
            return match;
        }

        public void setMatch(Boolean match) {
            this.match = match;
        }

        public Object getMismatchReason() {
            return mismatchReason;
        }

        public void setMismatchReason(Object mismatchReason) {
            this.mismatchReason = mismatchReason;
        }

        public int getStatus() {
            return status;
        }

        public String getStatusSrc() {
            if (1 == getStatus())
                return "去使用";
            else if (2 == getStatus())
                return "已使用";
            else return "领取";
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getTemplateId() {
            return templateId;
        }

        public void setTemplateId(String templateId) {
            this.templateId = templateId;
        }

        public String getTakeType() {
            return takeType;
        }

        public void setTakeType(String takeType) {
            this.takeType = takeType;
        }
    }

    public static class PromotionsDTO {
        private Integer id;
        private String name;
        private Integer typeX;
        private double totalPrice;
        private double discountPrice;
        private Boolean match;
        private String description;
        private List<ItemsDTO> itemsX;

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getTypeX() {
            return typeX;
        }

        public void setTypeX(Integer typeX) {
            this.typeX = typeX;
        }

        public double getTotalPrice() {
            return totalPrice;
        }

        public String getTotalPriceSrc() {
            return APIs.df.format(totalPrice / 100) + "元";
        }

        public void setTotalPrice(double totalPrice) {
            this.totalPrice = totalPrice;
        }

        public double getDiscountPrice() {
            return discountPrice;
        }

        public void setDiscountPrice(double discountPrice) {
            this.discountPrice = discountPrice;
        }

        public Boolean isMatch() {
            return match;
        }

        public void setMatch(Boolean match) {
            this.match = match;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public List<ItemsDTO> getItemsX() {
            return itemsX;
        }

        public void setItemsX(List<ItemsDTO> itemsX) {
            this.itemsX = itemsX;
        }

        public static class ItemsDTO {
            private Integer skuId;
            private double totalPrice;
            private double discountPrice;

            public Integer getSkuId() {
                return skuId;
            }

            public void setSkuId(Integer skuId) {
                this.skuId = skuId;
            }

            public double getTotalPrice() {
                return totalPrice;
            }

            public void setTotalPrice(double totalPrice) {
                this.totalPrice = totalPrice;
            }

            public double getDiscountPrice() {
                return discountPrice;
            }

            public void setDiscountPrice(double discountPrice) {
                this.discountPrice = discountPrice;
            }
        }
    }
}
